<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // 检测接口被调用所少次
    // num2为全局共有，容易被其他程序修改
    var num2 = 0
    function fun3() {
      num2++
      return num2
    }


    function fun1() {
      let num = 0
      function fun2() {
        num++
        return num
      }
      return fun2
    }
    // 浏览器调试，直接使用one()来调用
    let one = fun1()
    // console.log(one());
  </script>
</body>

</html>